package org.puppet.demo.tank.scene;

import java.util.Map;

import org.puppet.demo.tank.R;
import org.puppet.game.base.PuppetUtils;
import org.puppet.game.map.MapBlock;
import org.puppet.game.view.SceneView;

import android.content.Context;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.util.AttributeSet;

public class BattleView extends SceneView {

	public BattleView(Context context, AttributeSet attrs, Map inflateParams) {
		super(context, attrs, inflateParams);
		initMap();
	}

	public BattleView() {
		super(); 
		initMap();
	}
	public void initMap(){
		BattleMap map=new BattleMap();
		map.setBackground(resources.getDrawable(R.drawable.background));
		MapBlock block=null;
		Path path=null;
		
		block=new MapBlock(0f,160f);
		block.setMapImage(PuppetUtils.createBitmap(resources,R.drawable.map1));
		path=new Path();
		path.addRect(0, 160, 340, 220, Direction.CW);
		block.setPath(path);
		map.addBlock(block);
		
		block=new MapBlock(420f,30f);
		block.setMapImage(PuppetUtils.createBitmap(resources,R.drawable.map2));
		map.addBlock(block);
		
		setSceneMap(map);
	}
	
}
